home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
016a
/
frbts_20.zip
/
FROBOT.H
< prev
next >
Wrap
C/C++ Source or Header
|
1991-04-27
|
6KB
|
159 lines
/****************************************************************************/
/* */
/* Frobot.h Version 2.0 By Craig Derouen */
/* */
/* */
/* */
/****************************************************************************/
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <dos.h>
#include <direct.h>
#include <errno.h>
#include <malloc.h>
#include <sys\types.h>
#include <sys\stat.h>
#define Version 2.00
#define TRUE 1
#define FALSE 0
#define NOMEM 1
#define BADFILE 2
#define MAXLINE_SIZE 128
#define bit unsigned
#define sword signed int
#define word unsigned int
#define dword long int
#define byte unsigned char
struct _stamp /* DOS-style datestamp */
{
struct
{
unsigned int da : 5;
unsigned int mo : 4;
unsigned int yr : 7;
} date;
struct
{
unsigned int ss : 5;
unsigned int mm : 6;
unsigned int hh : 5;
} time;
};
/* FIdonet message format, stripped from OPU/Maximus */
struct _msg
{
byte from[36];
byte to[36];
byte subj[72];
byte date[20]; /* Obsolete/unused ASCII date information */
word times; /* FIDO<tm>: Number of times read */
sword dest; /* Destination node */
sword orig; /* Origination node number */
word cost; /* Unit cost charged to send the message */
sword orig_net; /* Origination network number */
sword dest_net; /* Destination network number */
/* A TIMESTAMP is a 32-bit integer in the Unix */
/* flavor (ie. the number of seconds since */
/* January 1, 1970). Timestamps in messages are */
/* always Greenwich Mean Time, never local time. */
struct _stamp date_written; /* When user wrote the msg */
struct _stamp date_arrived; /* When msg arrived on-line */
word reply; /* Current msg is a reply to this msg number */
word attr; /* Attribute (behavior) of the message */
word up; /* Next message in the thread */
};
/*--------------------------------------------------------------------------*/
/* Message attributes */
/*--------------------------------------------------------------------------*/
#define MSGPRIVATE 0x0001 /* private message * 0000 0000 0000 0001 */
#define MSGCRASH 0x0002 /* squirtmail * 0000 0000 0000 0010 */
#define MSGREAD 0x0004 /* read by addressee * 0000 0000 0000 0100 */
#define MSGSENT 0x0008 /* sent OK (remote) 0000 0000 0000 1000 */
#define MSGFILE 0x0010 /* file attached to msg * 0000 0000 0001 0000 */
#define MSGFWD 0x0020 /* in transit 0000 0000 0010 0000 */
#define MSGORPHAN 0x0040 /* unknown dest node 0000 0000 0100 0000 */
#define MSGKILL 0x0080 /* kill after bundling * 0000 0000 1000 0000 */
#define MSGLOCAL 0x0100 /* FidoNet vs. local 0000 0001 0000 0000 */
#define MSGHOLD 0x0200 /* Hold, don't send * 0000 0010 0000 0000 */
#define MSGXX2 0x0400 /* <reserved> X? 0000 0100 0000 0000 */
#define MSGFRQ 0x0800 /* file request * 0000 1000 0000 0000 */
#define MSGRRQ 0x1000 /* receipt requested X* 0001 0000 0000 0000 */
#define MSGCPT 0x2000 /* is a return receipt X* 0010 0000 0000 0000 */
#define MSGARQ 0x4000 /* audit trail requested X* 0100 0000 0000 0000 */
#define MSGURQ 0x8000 /* update request X* 1000 0000 0000 0000 */
/*-----------------------*/
/* ^ */
/* | */
/* * = preserved by */
/* the network */
/* ? = stripped by the */
/* net (FTSC spec) */
/* but preserved */
/* by seadog<tm> */
/* X = not used by Opus */
/*-----------------------*/
/* Prototypes */
int main(int argc,char **argv);
void showvers(void);
/* File.c */
int getparms(char *ctlfile);
int doscript(void);
void striptail(char *p);
void procline(char *line);
void commentline(char *line,char *str);
int validate(char *p2,char *line);
int filescan(FILE *infile,char *fname);
void createbackup(char *input,char *output);
void logit(char *strng,char flag);
char *timestring(void);
/* Misc.c */
void showparms(void);
int parsenet(char *str,unsigned int *zone,unsigned int *net,unsigned int *node);
void aborterror(int code,char *str);
void warble(void);
void utsound(int freq,int time);
unsigned utsleep(unsigned period);
int utgetclk(long *pcount);
void soundon(int freq);
void soundoff(void);
void strinsert(char *insstr,char *dest,int position);
void blanktrim(char *string);
int datecheck(char *inpstr);
int timecheck(char *inpstr);
/* Fidonet.c */
void file_send(char *p1,char *line,char *sendfile);
void file_request(char *line,char *reqfile);
int setdest(char *input,char *line);
int test_sfile(char *fname,FILE *flfile,int mode);
int test_rfile(char *fname,FILE *reqfile,int filetries,int count);
void DoFSendMsg(char *filename);
void DoFReqMsg(char *filename);
void DoNoteMsg(char *filename);
int create_msghdr(int destnode,int destnet,char *subject,unsigned attribute);
int find_fidohigh(char *msgpath);